package com.usf.jprovider.schema.provider.dao.key;

import java.sql.SQLException;

import com.usf.jprovider.object.JObjectNode;
import com.usf.jprovider.object.env.Environment;
import com.usf.jprovider.object.type.JType;
import com.usf.jprovider.tools.DAOTools;

public final class DAOSequence extends AbstractDAOKeySource {

	public DAOSequence() {
		super();
	}
	
	@Override
	protected String createUnformated(Environment env, JObjectNode node) throws SQLException {
		String query = env.getConnector().nextSequenceQuery(name);
		return DAOTools.executeSelectQuery(env.getConnection(), query);
	}
	@Override
	public boolean checkValue(Environment env, JObjectNode node,  JType<?> value) {
		return true; //log warn
	}
}
